<template>
     
    <div class="my-list">
              <ul>
                <li v-for='(item,index) in currentList' v-bind:key="index">
                  <router-link class="link" :to="`/sidebar/list/detail/?type=${types}&id=${index}`">
                     {{item}}
                  </router-link>
                       
               </li>
              </ul>
        </div>

</template>
<script>
export default {
 data() {
    return {
      systemList: [
        "全宗管理",
        "分类管理",
        "门类管理",
        "窗体模型",
        "用户管理",
        "数据字典",
        "数据表定义",
        "菜单设置",
        "角色管理",
         "系统参数",
        "操作日志",
        "全局报表",
        "全文路径管理",
        "档案统计",
        "组织结构",
         "职务管理",
        "人员管理",
        "借阅管理",
         "桌面整理",
        "统计",
        "组织结构",
         "职务管理",
        "人员管理",
        "借阅管理",
         "桌面整理",
        "统计"
      ],
       granttList: [
        "订单1",
        "订单10",
        "订单12",
        "订单12",
        "订单14",
        "订单15",
        "订单51",
        "订单61",
        "订单71",
        "订单61",
        "订单61",
        "订单19"
        ],
        currentList:[],
        types:""

}

 },
 created:function(){
   this.checkType();
 },
 methods:{
   checkType(){
    var that = this;
    var type = that.$route.query.type;
    that.types =  type;
  
  console.log("类型",type);
  switch(type){
    case "system": {
      that.currentList = that.systemList;
      break;
    }

     case "grant": {
       that.currentList = that.granttList;
       break;
     }
  }

   }
 },
 watch:{
   "$route":function(){
     this.checkType();
 
   }
 } 
 }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
  .my-list{
      width:100%;
      height:100%;
      background:rgba(204, 204, 204, 0.418);
      overflow: scroll;
      ul {
            width:100%;  
        li{
          width:100%;
          padding: 5px 0 5px 10%;
          margin-bottom:10px;
          background:rgb(179, 232, 245);
           
        }
      }
    
    }

</style>